<%@ page import="com.kgc.web.listener.MyOnlineListener" %>
<%@ page import="com.kgc.entity.User" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/3/4
  Time: 15:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>用户登录页</title>
</head>
<body>

<%
    //获取请求里传来的参数
    String userName = request.getParameter("onlineUser");
    //创建用户对象，把该用户对象存入session会话里
    session.setAttribute(userName,new MyOnlineListener(new User(userName)));
    pageContext.setAttribute("userName",userName);
%>
<h1>
    网站在线人数：${totalOnline}
</h1>
<h2>
    当前用户：${userName}
</h2>
<h3>
    <a href="index.jsp?userName=${userName}">用户-${userName}-退出登录</a>
</h3>
<h4>
    <a href="index.jsp">返回首页</a>
</h4>


</body>
</html>
